package com.iraeta.controller;

import com.iraeta.api.HikApi;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

@RestController
@RequestMapping("/hik")
public class HikController extends BaseController{
    @Autowired
    HikApi hikApi;

//    @GetMapping("getallmenjin")
//    public String getAllMenjin() throws Exception {
//        List<String> res = hikApi.getAllMenJin();
//        return this.success(res);
//    }

    @GetMapping("opendoor")
    public String openDoor() throws Exception {
        int res = hikApi.controlDoor(2);
        return this.success(res);
    }
    @GetMapping("opendoor4")
    public String openDoor4() throws Exception {
        int res = hikApi.controlDoor4floor(2);
        return this.success(res);
    }
}
